import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path';
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
	vue(),
	AutoImport({
		resolvers: [ElementPlusResolver()],
		imports: ['vue', 'vue-router'],
	}),
	Components({
		resolvers: [ElementPlusResolver()],
	}),
 ],
  server:{
    // 端口
    port: 8956
  },
  // 配置多页面打包
  build: {
		// 多页面打包配置
		rollupOptions: {
			input: {
				// 配置所有页面路径，使得所有页面都会被打包
				main: resolve(__dirname, 'index.html'),
				login: resolve(__dirname, 'login/index.html'),
			}
		}
	}
})
